﻿function Html()
{
    return {
        Table:
        {
            Parent: null,
            addCell: function (content, classes, styles, attributes)
            {
                //this.Parent = new Numeric(Numeric.DecimalSeparator, Numeric.ThousandsSeparator, Numeric.CurrencySymbol);
                //var formattedNumber = this.Parent.Formatting.format(number, decimalPlaces, decimalSeparator, thousandsSeparator);
                var _classes    = classes != null ? classes.join("") : "";
                var _styles     = styles != null ? styles.join("") : "";
                var _attributes = attributes != null ? attributes.join("") : "";
                return '<td class="' + _classes + '" style="' + _styles + '" ' + _attributes + ' >' + content + '</td>';
            },
            getAllRows: function (idTable)
            {
                return $("#" + idTable).find("tbody>tr");
            },
            getRow: function (idTable, idRow)
            {
                return $("#" + idTable + " tr[id='" + idRow + "']");
            },
            getCell: function (idTable, idRow, attributeName, attributeValue) {
                var tr = $("#" + idTable + " tr[id='" + idRow + "']");
                return tr.find("td[" + attributeName + "='" + attributeValue + "']");
            }
        }
    }
}